/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.warehouse3;

public class Item {

 private String manufacturerName;
    private String productType;  //data should come from the 3 different product types.
    private float unitPrice;
    private int quantity;



    public Item(String manufacturerName, String productType, float unitPrice, int quantity)
    {
        this.manufacturerName = manufacturerName;

        if(isAcceptableProductType(productType))
        {
            this.productType = productType;
        }
        else
        {
            this.productType = null;
        }

        this.unitPrice = unitPrice;
        this.quantity = quantity;
    }

    public Item()
    {
    }

    public String getManufacturerName() {
        return manufacturerName;
    }

    public String getProductType() {
        return productType;
    }

    public float getUnitPrice() {
        return unitPrice;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setManufacturerName(String manufacturerName) {
        this.manufacturerName = manufacturerName;
    }

    public void setProductType(String productType)
    {

        if(isAcceptableProductType(productType))
        {
            this.productType = productType;
        }
        else
        {
            this.productType = null;
        }

    }

    public void setUnitPrice(float unitPrice) {
        this.unitPrice = unitPrice;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }


    private boolean isAcceptableProductType(String productType)
    {
        if(productType.equalsIgnoreCase("DVD Player") || productType.equalsIgnoreCase("video camera") || productType.equalsIgnoreCase("TV"))
        {
            return true;
        }
        else
        {
            return false;
        }
    }

    public Item(Item i) {
        this.manufacturerName = i.manufacturerName;
        this.productType = i.productType;
        this.unitPrice = i.unitPrice;
        this.quantity = i.quantity;
    }


}